package com.happy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.happy.entity.RecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RecordMapper extends BaseMapper<RecordEntity> {

    @Select ( value = "select ri.id,\n" +
            "       ri.userId,\n" +
            "       ui.userName,\n" +
            "       ri.paperId,\n" +
            "       pi.paperName AS paperName,\n" +
            "       ri.createTime,\n" +
            "       ri.changeTime,\n" +
            "       ri.isUsed\n" +
            "from record_info ri\n" +
            "         left join paper_info pi on ri.paperId = pi.paperId\n" +
            "         left join user_info ui on ui.id = ri.userId\n")
    List<RecordEntity> queryList ( );

}
